package org.graduates.webapp.actions.course;


import org.graduates.webapp.actions.BaseAction;
import org.projects.graduates.domain.Course;
import org.projects.graduates.domain.RepeatType;

import com.opensymphony.xwork2.ActionSupport;

public class ArrangementCourseAction extends BaseAction {
	private static final long serialVersionUID = 1806782554823894529L;

	private Course course;

	private RepeatType[] types = null;

	private long courseId = 0L;

	public String execute() {
		if (courseId == 0L) {
			return ActionSupport.INPUT;
		}

		course = Course.get(Course.class, courseId);

		if (course == null) {
			return ActionSupport.INPUT;
		}

		types = RepeatType.values();

		return ActionSupport.SUCCESS;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public long getCourseId() {
		return courseId;
	}

	public void setCourseId(long courseId) {
		this.courseId = courseId;
	}

	public RepeatType[] getTypes() {
		return types;
	}

	public void setTypes(RepeatType[] types) {
		this.types = types;
	}

}
